package chapter19.homework3;

import java.util.ArrayList;

public abstract class AbstractObjectList {//抽象聚合类
    ArrayList<Object> arrayList = new ArrayList<>();

    public  AbstractObjectList(ArrayList<Object>arrayList) {//将数据存放在数组
        this.arrayList = arrayList;
    }

    public void addObject(Object o){//添加元素
        this.arrayList.add(o);
    }

    public void removeObject(Object o){//删除元素
        this.arrayList.remove(o);
    }

    public ArrayList<Object> getArrayList(){//获得数据元素
        return this.arrayList;
    }

    public abstract AbstractIterator createI() ;//迭代器的抽象方法...

}
